import request from "@/utils/request";

// 获取全部数据
export function getQueryall(data) {
    return request({
        url: `/back/post/queryall?pageNum=${data.pageNum}&pageSize=${data.pageSize}`,
        method: 'GET',
        data: data,
    })
}

// 搜索
export function getSearch(data) {
    return request({
        url: `/back/post/query`,
        method: 'GET',
        params: data
    })
}
// 删除
export function Delpost(id) {
    return request({
        url: `/back/post/delete?id=${id}`,
        method: 'DELETE',
    })
}
// 新增
export function postAdd(data) {
    console.log('console.log(data),', data)
    return request({
        url: `/back/post/add`,
        method: 'post',
        data: data,
    })
}
// 修改
export function update(data) {
    console.log('console.log(data),', data)
    return request({
        url: `/back/post/update`,
        method: 'PUT',
        data: data,
    })
}
// 根据id渲染数据
export function getId(data) {
    console.log('console.log(data),', data.id)
    return request({
        url: `/back/post/queryid?id=${data.id}`,
        method: 'get',
    })
}
// 根据id渲染数据
export function getCompanyName(data) {
    return request({
        url: `/back/enterprise/getCompanyName`,
        method: 'get',
        params: data
    })
}